<template>
    <header class="header">
      <h1>todos</h1>
      <input class="new-todo" placeholder="请输入任务名称" autofocus v-model.trim="listForm" @keyup.enter="subData"/>
    </header>

</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
      listForm:''
    }
  },
  computed: {
 
  },
  watch: {
  
  },
  created() {},
  methods: {
    subData(){
      if(this.listForm==='') return alert('请输入内容')
      this.$emit('subData',this.listForm)
      this.listForm=''
    }
  },

}
</script>

<style scoped></style>
